<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<% 
		String DB_URL = "jdbc:mysql://localhost/mytest";
		String DB_USER = "root";
		String DB_PASSWORD = "root";
		
		Connection conn;
		Statement stmt;
		String query = "select * from mytest";
		ResultSet rs = null;
		try {
				Class.forName("org.gjt.mm.mysql.Driver");
				conn = DriverManager.getConnection(DB_URL, DB_USER, DB_PASSWORD);
				stmt = conn.createStatement();
				rs = stmt.executeQuery(query);
				while(rs.next()) {
						out.println(rs.getString(1));
						out.println("");
				}
				rs.close();
				conn.close();
				stmt.close();
				out.println("mysql jdbc test: ok");
		} catch(Exception e) {
				out.println(e.getMessage());
		}%>
</body>
</html>